#include <iostream>
#include <vector>
#include <climits>

using namespace std;

// 2379. 得到 K 个黑块的最少涂色次数
// https://leetcode.cn/problems/minimum-recolors-to-get-k-consecutive-black-blocks/description/

class Solution {
public:
    int minimumRecolors(string blocks, int k) {
        int left = 0;
        int cOpt = 0;
        int ans = INT_MAX;
        for (int i = 0; i < blocks.size(); i++)
        {
            if(blocks[i] == 'W'){
                cOpt++;
            }

            if(i - left + 1 < k){
                continue;
            }

            ans = min(ans, cOpt);
            if(blocks[left++] == 'W'){
                cOpt--;
            }
        }
        return ans;
    }
};

int main()
{
    return 0;
}